/*
 * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The OpenAirInterface Software Alliance licenses this file to You under
 * the OAI Public License, Version 1.1  (the "License"); you may not use this
 * file except in compliance with the License. You may obtain a copy of the
 * License at
 *
 *      http://www.openairinterface.org/?page_id=698
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *-------------------------------------------------------------------------------
 * For more information about the OpenAirInterface (OAI) Software Alliance:
 *      contact@openairinterface.org
 */
/**
 * Nudr_DataRepository API OpenAPI file
 * Unified Data Repository Service. © 2020, 3GPP Organizational Partners (ARIB,
 * ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
 *
 * The version of the OpenAPI document: 2.1.2
 *
 *
 * NOTE: This class is auto generated by OpenAPI Generator
 * (https://openapi-generator.tech). https://openapi-generator.tech Do not edit
 * the class manually.
 */

#include "ProblemDetails.h"

namespace oai::udr::model {

ProblemDetails::ProblemDetails() {
  m_Type = "";
  m_TypeIsSet = false;
  m_Title = "";
  m_TitleIsSet = false;
  m_Status = 0;
  m_StatusIsSet = false;
  m_Detail = "";
  m_DetailIsSet = false;
  m_Instance = "";
  m_InstanceIsSet = false;
  m_Cause = "";
  m_CauseIsSet = false;
  m_InvalidParamsIsSet = false;
  m_SupportedFeatures = "";
  m_SupportedFeaturesIsSet = false;
  m_TargetScp = "";
  m_TargetScpIsSet = false;
}

ProblemDetails::~ProblemDetails() {}

void ProblemDetails::validate() {
  // TODO: implement validation
}

void to_json(nlohmann::json &j, const ProblemDetails &o) {
  j = nlohmann::json();
  if (o.typeIsSet())
    j["type"] = o.m_Type;
  if (o.titleIsSet())
    j["title"] = o.m_Title;
  if (o.statusIsSet())
    j["status"] = o.m_Status;
  if (o.detailIsSet())
    j["detail"] = o.m_Detail;
  if (o.instanceIsSet())
    j["instance"] = o.m_Instance;
  if (o.causeIsSet())
    j["cause"] = o.m_Cause;
  if (o.invalidParamsIsSet() || !o.m_InvalidParams.empty())
    j["invalidParams"] = o.m_InvalidParams;
  if (o.supportedFeaturesIsSet())
    j["supportedFeatures"] = o.m_SupportedFeatures;
  if (o.targetScpIsSet())
    j["targetScp"] = o.m_TargetScp;
}

void from_json(const nlohmann::json &j, ProblemDetails &o) {
  if (j.find("type") != j.end()) {
    j.at("type").get_to(o.m_Type);
    o.m_TypeIsSet = true;
  }
  if (j.find("title") != j.end()) {
    j.at("title").get_to(o.m_Title);
    o.m_TitleIsSet = true;
  }
  if (j.find("status") != j.end()) {
    j.at("status").get_to(o.m_Status);
    o.m_StatusIsSet = true;
  }
  if (j.find("detail") != j.end()) {
    j.at("detail").get_to(o.m_Detail);
    o.m_DetailIsSet = true;
  }
  if (j.find("instance") != j.end()) {
    j.at("instance").get_to(o.m_Instance);
    o.m_InstanceIsSet = true;
  }
  if (j.find("cause") != j.end()) {
    j.at("cause").get_to(o.m_Cause);
    o.m_CauseIsSet = true;
  }
  if (j.find("invalidParams") != j.end()) {
    j.at("invalidParams").get_to(o.m_InvalidParams);
    o.m_InvalidParamsIsSet = true;
  }
  if (j.find("supportedFeatures") != j.end()) {
    j.at("supportedFeatures").get_to(o.m_SupportedFeatures);
    o.m_SupportedFeaturesIsSet = true;
  }
  if (j.find("targetScp") != j.end()) {
    j.at("targetScp").get_to(o.m_TargetScp);
    o.m_TargetScpIsSet = true;
  }
}

std::string ProblemDetails::getType() const { return m_Type; }
void ProblemDetails::setType(std::string const &value) {
  m_Type = value;
  m_TypeIsSet = true;
}
bool ProblemDetails::typeIsSet() const { return m_TypeIsSet; }
void ProblemDetails::unsetType() { m_TypeIsSet = false; }
std::string ProblemDetails::getTitle() const { return m_Title; }
void ProblemDetails::setTitle(std::string const &value) {
  m_Title = value;
  m_TitleIsSet = true;
}
bool ProblemDetails::titleIsSet() const { return m_TitleIsSet; }
void ProblemDetails::unsetTitle() { m_TitleIsSet = false; }
int32_t ProblemDetails::getStatus() const { return m_Status; }
void ProblemDetails::setStatus(int32_t const value) {
  m_Status = value;
  m_StatusIsSet = true;
}
bool ProblemDetails::statusIsSet() const { return m_StatusIsSet; }
void ProblemDetails::unsetStatus() { m_StatusIsSet = false; }
std::string ProblemDetails::getDetail() const { return m_Detail; }
void ProblemDetails::setDetail(std::string const &value) {
  m_Detail = value;
  m_DetailIsSet = true;
}
bool ProblemDetails::detailIsSet() const { return m_DetailIsSet; }
void ProblemDetails::unsetDetail() { m_DetailIsSet = false; }
std::string ProblemDetails::getInstance() const { return m_Instance; }
void ProblemDetails::setInstance(std::string const &value) {
  m_Instance = value;
  m_InstanceIsSet = true;
}
bool ProblemDetails::instanceIsSet() const { return m_InstanceIsSet; }
void ProblemDetails::unsetInstance() { m_InstanceIsSet = false; }
std::string ProblemDetails::getCause() const { return m_Cause; }
void ProblemDetails::setCause(std::string const &value) {
  m_Cause = value;
  m_CauseIsSet = true;
}
bool ProblemDetails::causeIsSet() const { return m_CauseIsSet; }
void ProblemDetails::unsetCause() { m_CauseIsSet = false; }
std::vector<InvalidParam> &ProblemDetails::getInvalidParams() {
  return m_InvalidParams;
}
void ProblemDetails::setInvalidParams(std::vector<InvalidParam> const &value) {
  m_InvalidParams = value;
  m_InvalidParamsIsSet = true;
}
bool ProblemDetails::invalidParamsIsSet() const { return m_InvalidParamsIsSet; }
void ProblemDetails::unsetInvalidParams() { m_InvalidParamsIsSet = false; }
std::string ProblemDetails::getSupportedFeatures() const {
  return m_SupportedFeatures;
}
void ProblemDetails::setSupportedFeatures(std::string const &value) {
  m_SupportedFeatures = value;
  m_SupportedFeaturesIsSet = true;
}
bool ProblemDetails::supportedFeaturesIsSet() const {
  return m_SupportedFeaturesIsSet;
}
void ProblemDetails::unsetSupportedFeatures() {
  m_SupportedFeaturesIsSet = false;
}
std::string ProblemDetails::getTargetScp() const { return m_TargetScp; }
void ProblemDetails::setTargetScp(std::string const &value) {
  m_TargetScp = value;
  m_TargetScpIsSet = true;
}
bool ProblemDetails::targetScpIsSet() const { return m_TargetScpIsSet; }
void ProblemDetails::unsetTargetScp() { m_TargetScpIsSet = false; }

} // namespace oai::udr::model
